.TH "IXP_SRV_READBUF" 3 "2012 Dec" "libixp Manual"


.SH NAME

.P
ixp_srv_readbuf, ixp_srv_writebuf

.SH SYNOPSIS

.nf
#include <ixp_srvutil.h>

void ixp_srv_readbuf(Ixp9Req *req, char *buf, uint len);

void ixp_srv_writebuf(Ixp9Req *req, char **buf, uint *len, uint max);
.fi


.SH DESCRIPTION

.P
Utility functions for handling TRead and TWrite requests for
files backed by in\-memory buffers. For both functions, \fIbuf\fR
points to a buffer and \fIlen\fR specifies the length of the
buffer. In the case of ixp_srv_writebuf, these values add a
level of pointer indirection, and updates the values if they
change.

.P
If \fImax\fR has a value other than 0, ixp_srv_writebuf will
truncate any writes to that point in the buffer. Otherwise,
\fI*buf\fR is assumed to be malloc(3) allocated, and is
reallocated to fit the new data as necessary. The buffer is
is always left nul\-terminated.

.SH BUGS

.P
ixp_srv_writebuf always truncates its buffer to the end
of the most recent write.

.\" man code generated by txt2tags 2.6 (http://txt2tags.org)
.\" cmdline: txt2tags -o- ixp_srv_readbuf.man3
